function [ub,lb]  = set_ublb(hipdatatype)
ubmat = 50*ones(5,5);
lbmat = -50*ones(5,5);
%%upper and lower bounds on the hip velocity of the robot
ubmat(1,1) = 0.8; %%% SHU
lbmat(1,1) = 0.1;

%%Add any constraints to the torso fit function here
% ubmat(5,:) = 0.1*ones(1,5);
% lbmat(5,:) = -0.0*ones(1,5);
%%%
ubmat(1,3) = 0; ubmat(1,4) = 0; ubmat(1,5) = 0;
lbmat(1,3) = 0; lbmat(1,4) = 0; lbmat(1,5) = 0;
if hipdatatype ~= 4
    lbmat(1,2) = 0;
    ubmat(1,2) = 0;
end
%%%
ub = flatten(ubmat)
lb = flatten(lbmat);
end

function aflat = flatten(a)
aflat = a(:);

end

function aunflat = unflatten(aflat)

qdim = 5;
aunflat = reshape(aflat,qdim,5);

end